package com.lww.feature.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;


/**
 * @author: LiWeiWei
 * Date: 2018/11/14
 */
@RestController
@RequestMapping("/PerformanceTesting")
public class PerformanceTestingController {


    @RequestMapping("/test1")
    public HashMap test1(int ms) throws InterruptedException {
        // 从钉钉查询用户id
        if (ms > 0) {
            Thread.sleep(ms);
        }
        HashMap<String, Object> result = new HashMap<>();
        result.put("code",1);
        return result;
    }


    @RequestMapping("/test2")
    public HashMap test2(int ms) throws InterruptedException {
        if (ms > 0) {
            Thread.sleep(ms);
        }
        HashMap<String, Object> result = new HashMap<>();
        result.put("code",2);
        return result;
    }

    @RequestMapping("/test3")
    public HashMap test3(int ms) throws InterruptedException {
        if (ms > 0) {
            Thread.sleep(ms);
        }
        HashMap<String, Object> result = new HashMap<>();
        result.put("code",3);
        return result;
    }

    @RequestMapping("/test4")
    public HashMap test4(int ms) throws InterruptedException {
        if (ms > 0) {
            Thread.sleep(ms);
        }
        HashMap<String, Object> result = new HashMap<>();
        result.put("code",4);
        return result;
    }

    @RequestMapping("/test5")
    public HashMap test5(int ms) throws InterruptedException {
        if (ms > 0) {
            Thread.sleep(ms);
        }
        HashMap<String, Object> result = new HashMap<>();
        result.put("code",5);
        return result;
    }

}
